﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="VerticalMenu.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
<!--    //--><![CDATA[//><!--
    function getUrlParam(varname) {
        varname = varname.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regexS = "[\\?&]" + varname + "=([^&#]*)";
        var regex = new RegExp(regexS);
        var results = regex.exec(window.location.href);
        if (results == null) return ""; else return results[1];
    }

    function Test() {
        var p = gup('hello');
        alert('hello '+p); 
    }

    startList = function () {

        if (document.getElementById) {
            navRoot = document.getElementById("navigation");
            for (i = 0; i < navRoot.childNodes.length; i++) {
                node = navRoot.childNodes[i];
                if (node.nodeName == "LI") {
                    // colaps all
                    //if (this.id != getUrlParam('menu')) {
                    //    node.className = "off";
                    //}
                    // attach onClock event
                    node.onclick = function () {
                        alert('it=' + getUrlParam('menu'));
                        if (this.id != getUrlParam('menu')) {
                            this.className = (this.className == "on") ? "off" : "on";
                        }

                    }
                }
            }
        }
    }
    window.onload = startList;
    //--><!]]>
</script>

    <style>
    
    </style>
</head>
<body>

    <ul id="navigation">
        <li id="Dashboard"><a href="#">Dashboard</a></li>
        <li id="Posts"><a href="#">Posts</a>
            <ul>
                <li><a href="#">All Posts</a></li>
                <li><a href="#">Add New</a></li>
                <li><a href="#">Categories</a></li>
                <li><a href="#">Post Tags</a></li>
            </ul>
        </li>
        <li id="Media"><a href="http://localhost:55246/Content/VerticalMenu.htm">Media</a>
            <ul>
                <li id="Media1"><a href="http://localhost:55246/Content/VerticalMenu.htm?menu=Media">Lybrary</a></li>
                <li id="Media2"><a href="http://localhost:55246/Content/VerticalMenu.htm?menu=Media">Add Media</a></li>
            </ul>
        </li>
        <li id="Links"><a href="#">Links</a>
            <ul>
                <li><a href="#">All Links</a></li>
                <li><a href="#">Add New</a></li>
                <li><a href="#">Link Categories</a></li>
            </ul>
        </li>
        <li id="Pages"><a href="#">Pages</a>
            <ul>
                <li><a href="#">All Pages</a></li>
                <li><a href="#">Add New</a></li>
            </ul>
        </li>
        <li id="Comments"><a href="#">Comments</a></li>
    </ul>


    <a href="#" onclick="Test()">ClickMe</a>
</body>
</html>
